Detailed-based dictionary learning for low-light image enhancement using camera response model for industrial applications

Images captured in low-light environments are severely degraded due to insufficient light, which causes the performance decline of both commercial and consumer devices. One of the major challenges lies in how to balance the image enhancement properties of light intensity, detail presentation, and colour integrity in low-light enhancement tasks. This study presents a novel image enhancement framework using a detailed-based dictionary learning and camera response model (CRM). It combines dictionary learning with edge-aware filter-based detail enhancement. It assumes each small detail patch could be sparsely characterised in the over-complete detail dictionary that was learned from many training detail patches using iterative \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\ell}}_{1}$$\end{document}ℓ1-norm minimization. Dictionary learning will effectively address several enhancement concerns in the progression of detail enhancement if we remove the visibility limit of training detail patches in the enhanced detail patches. We apply illumination estimation schemes to the selected CRM and the subsequent exposure ratio maps, which recover a novel enhanced detail layer and generate a high-quality output with detailed visibility when there is a training set of higher-quality images. We estimate the exposure ratio of each pixel using illumination estimation techniques. The selected camera response model adjusts each pixel to the desired exposure based on the computed exposure ratio map. Extensive experimental analysis shows an advantage of the proposed method that it can obtain enhanced results with acceptable distortions. The proposed research article can be generalised to address numerous other similar problems, such as image enhancement for remote sensing or underwater applications, medical imaging, and foggy or dusty conditions.

from paired normal or low light images is proposed.The given linear bands are then reconstructed using a different learnable linear transformation based on an adversarial learning scheme driven by perceptual quality using unpaired data to get this enhanced representation.A recent deep learning network (DLN) took advantage of the recent development of CNNs 21 .A number of lightning back projection blocks (LBPs) compose the proposed deep learning network.The LBPs iteratively perform darkening and brightening operations to learn the residual from normal illumination estimations.This method further introduced a feature aggregation block that adaptably aggregates the outputs of many LBPs to fully utilise the local and global properties.Zhu et al. 22 introduced two parallel branches for enhancing low-light images by learning several forms of correction.In particular, the two branches directly forecast pixel offsets to enhance local details and build global transformation curves to enhance overall contrast.Additionally, the technique generates a differentiable histogram loss, which offers guidance on the overall contrast.Hu et al. 23 proposed a dual stage unsupervised technique that divides enhancement problem into a pre-enhancing as well as post refinement issue.The low light image is initially pre enhanced utilising a traditional Retinex-based algorithm.To further enhance the image quality, it employs a refinement network trained using adversarial training in the second stage.We introduced a novel context-sensitive decomposition link to address issues with the two-stream method for picture improvement 24 .The spatially varying lightning guidance is introduced to achieve the edge aware smoothness property of the lighting element.A competent end to end attention guided technique based on multi-branch CNN for enhancing images was established by Lv et al. 25 .It first constructs a simulated database using carefully crafted low illumination modelling models.This database is far larger and highly diversified compared to those that are already available.Further, it learns dual attention maps for controlling the tasks of enhancing intensity as well as denoising using a novel dataset as training data.Zhao et al. developed a generative method for Retinex disintegration, where disintegration is considered a generative concern 26 .The Retinex decomposition is performed by the RetinexDIP without the aid of any outdoor images and enhancement is carried out using swiftly adjusted approximated illumination.Further, PRIEN was proposed based on neural networks 27 .The main concept involves employing a recursive unit made up of a residual block and a recursive layer for unfolding the source image to extract features periodically.EnlightenGAN, a more efficient unsupervised GAN was developed by Jiang et al. 28 , where the network is trained with image pairs and shows excellent generalisation on the range of test images captured in the real world.The proposed strategy promises to regularise unpaired training utilising data collected from the input itself rather than supervising the learning with ground truth data.It also recommends numerous enhancements, such as the attention mechanism, self-regularised perceptual loss fusion and global-local discriminator structures for low light enhancement tasks.
A competent unsupervised disintegration and correction network for enhancing low illumination images was introduced recently 29 .This technique draws its inspiration from the Retinex model, which first divides images into their light and reflectance components and does not use paired data for training.An illumination correction network (ICN) processes the decomposed illumination after which it fuses it with reflectance to get an initial boosted output.To split a photograph into reflectance and illumination layers, Wu et al. 30 present a Retinex-based deep unfolding network that unfolds an optimisation issue for the learnable network.The three learning related schemes that are accountable for data dependent initialisation, extremely effective unfolding optimisation and user defined illumination are meticulously built by formulating the disintegration concern and an implicit priors regularised method.A competent model for enhancing low light images was introduced recently 31 .Using these three subnets, it performs decomposition, denoising, enhancing contrast and maintaining details.This method utilises both frequency information and spatial data of an image to maintain the characteristics while enhancing the contrast.A dual stage unsupervised model to improve low illumination photographs is established by Xiong et al. 32 .The method recommends an illumination aware denoising method at the stage of noise suppression in order to minimise actual noise at various locations under the effect of lighting conditions.The method generates false triplet samples to enable unsupervised training and proposes an adaptive content loss to maintain contextual information.Fan et al. 33 developed an enhancement method for improving low illumination photographs.Liu et al. 34 present a LAENet for low illumination image enhancement.Liu et al. 34 present a LAENet for enhancement of low illumination images.This method openly rethinks the spatial-frequency property of human vision, and actual research is performed on the correlation between spatial frequency, receptive field size, and light enhancing properties.Jiang et al. 35 introduced DEANet, a special Retinex-based convolutional neural network for improving low-light photographs.Wang et al. 36 introduced a BrightFormer in enhancing low illumination photographs that incorporates convolutions and transformers.Some of the main findings of this study include the fusion of local and global information using spatial and channel attention in feature equalisation.Further, the use of gated parameters and illumination based prior knowledge in self-attention will improve feature expression flexibility and make it simpler to extract global features.As a result, local features are preserved, eliminating useless features.
In this paper, we present a low light image enhancement scheme based on detailed-based dictionary learning and a camera response model.The dictionary training and sparse reconstruction are the first two steps in the detailed-based dictionary learning process.Then, using a training pairs of detail patches obtained from high-quality images, we train the over-complete detail dictionary by progressively lowering a ℓ1-norm energy function.We use the training dictionary to restore the increased detail layer during the reconstruction stage.We also provide a gradient guided optimisation technique to increase local coherence between patches.In order to get enhancement outcomes that maintain naturalness, we also consider in-camera processing when creating enhancement algorithms.The pixel value and light input do not typically have an inverse relationship in digital cameras.The camera response function (CRF) is a nonlinear function that connects the pixel value of an image with the irradiance of the camera sensor.We present CRF-based paradigm for improving low-light images.There are two main steps to the process; first optimise a camera response model (CRM) and its parameters.According to our study, designing a reliable algorithm to determine the three-color channel response curves utilising just low illumination images is difficult.Thus, we used a suitable fixed response curves as a substitute to retrieve the model parameters.We confirm that these approximations do not introduce any notable quality drops in results for most cameras.Furthermore, we utilise lighting estimation algorithms to compute an exposure map that contains the desired exposure ratio for each pixel.
The main contributions of the proposed method are summarised as follows: • This study introduces dictionary learning for image enhancement, which employs sparse reconstruction and dictionary training to improve image quality.• This strategy incorporates the Retinex model, and the camera response model while local exposure adjust- ments are performed for low-illumination images to obtain high-quality images.• The proposed method demonstrates how to achieve better results with fewer distortions using reasonable fixed camera response curves (CRCs) rather than computing precise three-channel response curves.• In addition to image enhancement of low-light images, the proposed algorithm can be utilised to perform other applications such as medical image enhancement, enhancing underwater images, remote sensing image enhancement, and dusty weather image enhancement.
The remainder part of the study is structured as follows.The related works are briefly illustrated in "Related work" section.The proposed image enhancement method using detailed based dictionary learning and a camera response model is summarised in "Methods" section."Experimental results" section exhibits comprehensive experimental details, results, and discussion using publicly available datasets."Conclusions" section concludes our work and illustrates some potential future work.

Related work
This section illustrates an edge-aware filter based on guided image filter, dictionary learning, camera response function (CRF) and brightness transform function (BTF) which is relatable to our enhancement method.

Edge-aware filter based on a guided image filter
In contrast to conventional filters however, edge aware filters are a set of special image manipulation strategies because of their accuracy to image structures.These filters appropriately maintain image details by decomposing images into their base and detail layers.He et al. 37 introduced fast and non approximate linear time filter that generates good quality filtering results while considering information from a guiding image also known as a guided image filter.This filter represents a translation variant filter based on a local linear model.It consists of three parts, an input image I, a guidance image G and an output image O.The basic requirements for this filtering are as follows; (a) the total linear result represents the linear transform of the guidance image G, and (b) a guidance image G is as identical as possible to the input image I.The initial conditions show that: where ω k represents a square window of dimension (2r + 1) × (2r + 1) .The local filter model assures that a resultant image O has edges only in the regions where a guidance image also has one, since ∇O = a∇G .In ω k , the linear components (a k , b k ) are fixed.They can be calculated by minimising a cost function E, or by minimis- ing the squared difference between the resultant image O and the input image I in the window ω k as follows: where ε represent regularisation factor panelising larger a k .The components (a k , b k ) can be computed instantly using linear regression 37 .The value of O i in Eq. (1) depends on window where pixel i may be present in many (overlapping) windows ω k .It can be described by averaging over all probable values of O i as where a i and b i represent mean components across all overlapping window i.Despite the linear components a i and b i fluctuate spatially, their gradient can be lesser than G near robust edges.Thus, we have ∇O = a∇G , which indicates sudden intensity shifts from a guidance image are still mostly maintained in the resultant image O. Equation (3) gives a description of the guided image filtering.When a source image also acts as a guidance image, a guided filter acts similar to bilateral filter.However, this filter prevents gradient reversal artefacts since it is an edge-preserving function with great computing efficiency.The edge aware filters are broadly utilised in image processing as well as computer visions such as detail enhancement, image smoothing, detail extraction, non-photorealistic rendering, and others.

Dictionary learning
For instance, dictionary learning 38 has been shown to be a sophisticated learning method in image processing and compute vision, where it has been used abundantly for a variety of applications including image restoration 39 , image super-resolution 40 , image denoising 41 and others.With the use of a dictionary of the basic components learned from the images, it splits the image into the basic components.The two important stages in the method are the training dictionary and the computation of sparse coefficients to represent signals utilising image dictionary components.In this study, edge-aware filter-based detail enhancement is first integrated with a dictionary learning.It assumed that each smaller detail patch may be sparsely characterized in the over complete detail dictionary from numerous training detail patches.As a result, by mapping the visibility restriction of training detail (1) www.nature.com/scientificreports/patches into enhanced detail patches, the dictionary learning may successfully address a variety of appearance concerns in the procedure of enhancing details.Once there is training pairs of better-quality images, we can use trained dictionary to restore the enhanced detail layers and generate an enhanced output with a clear visibility.
In the training stage, we first employ some advanced cameras to collect enough high-quality photos.Then we randomly extract a lot of small patches from these images with photographic appearances and simply compute their local intensity differences as detail patches.Finally, we construct a training set of detail patches and train an overcomplete detail dictionary by iteratively minimizing an ℓ1-norm energy function.The impact of images of different camera exposures on dictionary learning is negligible.Since we employed advanced cameras with HDR mode to collect these high-quality photos.Their HDR mode can take multi-exposure photos in a scene to compose a high dynamic range 42 .

Camera response function (CRF) and brightness transform function (BTF)
Numerous computer vision algorithms assume that the scene irradiance is accurately recorded by the image intensity.To enhance the visual quality of acquired photographs, camera manufacturers nevertheless consistently employ various non-linear camera techniques, like while balance as well as demosaicing.Thus, ignoring these processes may result in a reduction in algorithmic efficiency for algorithms that need to determine scene attributes like irradiance and illumination 43 .The camera response function (CRF) has been introduced to design those non-linear camera procedures.As a result, CRF determines the relationship between pixel values (P) and image irradiance (E).
where f represents a nonlinear CRF function.An irradiance E to the camera sensor can change linearly as the settings of camera exposure get adjusted.But the intensity of image P may not alter linearly in numerous situations due to the nonlinear in-camera systems.
As a result, a mapping function between several exposure photographs could also be non-linear function.The mapping function is known as BTF.It explains the correlation between two images P 0 and P 1 that were captured at different exposures while in the same scene as where k represents an exposure ratio and g is a BTF.The characteristics of camera imaging processing are defined by CRF and BTF.The camera response model is made up of these two functions.By means of using the descriptions of CRF and BTF, we get the equation shown below as Above equation is known as comparametric.It explains a bond between f and g .The two functions could be mutually converted using the comparametric equation.In Ref. 44 , it makes three assumptions to determine the similarities between f and g .First, f is constant for all pixels on the sensor.Next, a range of f (•) could be normalised to [0,1] .Lastly, f increases monotonically.Under these assumptions, define F : |0,1| → |0, 1| as a hypothetical space of f as We observed that BTF and CRF share the same common features according to Eq. ( 6).

Methods
In general, most of the state-of-the-art algorithms extract image detail and then boost it to produce an enhanced appearance.The suitability of obtaining and enhancing the detail layer such as construction of advanced camera determines the appearance effect in the images 42 .Here the typical enhancement model could be determined using following function as: where I represent an input image, d * represent an enhanced detail layer, d represent a main detail layer and n indi- cate a scaler factor where it is set to 5 in our study and E represent an initial enhanced result.In Eq. ( 8), the detail layer is produced by edge aware filter (as discussed in "Edge-aware filter based on a guided image filter" section).

Detailed-based dictionary learning
We often restore visual quality using the detail dictionary trained using a large number of higher quality images.We considered an enhanced detail patch could sparsely be characterized in the adequately selected over overcomplete dictionary.Based on hypothesis, we further recommend the new learning-based enhancement approach described below: where x represents a small patch of an image while d * x ǫR N , and N represent an amount of pixels in each small patch x, D ∈ R N×K represent an over complete dictionary trained from detail patches sampled from higher quality photographs, where K represent number of atoms in dictionary D, α represent coefficient vector of sparse representation for some α ∈ R k with �α� 0 ≪ K. Equation ( 9) represent the enhanced detail patch d * x (4) which specifies a sparse linear combination relating to detail dictionary with K atoms and α x indicates vector with very less (≪ N) non zero entries.Undoubtedly, a novel model focusses on finding the solution for sparse components.It is an NP hard optimisation concern since the optimised components must be adequately sparse.
We define a ℓ 1 -norm minimization function using a trained dictionary to balance the sparsity solution and limit the approximation to the enhanced detail layer nd x : where α * x represent ideal sparse components and denote balance parameter between fidelity and sparsity.As soon as the components have been optimally executed, a novel enhanced detail layers could be effectively restored as d * x = Dα * x .In Eq. ( 10), an optimisation and reconstruction should carry an over-complete dictionary that has been pretrained from significant number of sampled detail patches.
In dictionary learning, adequate high-quality enhanced photographs are required according to Eq. ( 9).The low-quality images are often manually improved in conventional method and the yields their enhanced results.The boosted results are simulated and insufficient to create a perfect training set because manual enhancement is difficult to maintain a consistent quality.Thankfully, certain advanced cameras offer HDR modes that enable many images to be taken simultaneously at several exposure levels and combined into a higher quality HDR image.We will be able to gather a lot of training photographs that are of photographic as a result rather than then enhancement results of manual modification.Further, the training pairs can be successfully formed by sampling from these superior quality images.First, we arbitrarily extract the large number of small patches from the training pairs P = L 1 , L 2 , . . ., L m to simulate the photographic enhancing results and then we simply calculate local intensity difference in order to create a training pairs of detail patches Where the dictionary learning should completely assure component sparsity obtained by ℓ1-norm minimisation in Eq. (10).We determine a new ℓ1-norm minimisation function for solving detail dictionary and ensure component sparsity as where each column of D can eliminate scaling uncertainty using of α is to ensure sparsity, λ represent a balance parameter between dual items of function set to 0.1.In Eq. ( 11), an optimisation generally performed is an alternate manner over two unknowns D and α .We first utilise a Gaussian random matrix to initialise a detail dictionary D with normalised columns.Next, we correct the dictionary D and modify sparse component α using a minimisation practice as shown below: where linear programming could be used to resolve this issue successfully.Finally, we repair the sparse coefficients α and revise the detail dictionary D using ℓ 2 -norm minimisation function.This problem is considered as classic example of quadratically restricted quadratic programming.Then, until step Eq. ( 11) of the optimisation problem converges, we iterate between Eqs. ( 12) and (13).We have so far successfully completed training procedure and retrieved an adequate detail dictionary D. The dictionary will be used to enhance low-light photographs with a high-quality appearance.

Sparse reconstruction
It intends to boost the overall visual quality of enhanced output of dictionary learning.In Eq. ( 10), it specifies that early enhanced detail layer is significant for reconstruction in addition to trained dictionary.Thus, the detail layer is extracted using a rapid and non-approximate linear time filtering 37 , then directly multiply a scale factor n in order to boosting it.Furthermore, other edge aware filters can be utilised for generating a detail layer if we need to maximise their enhancing impacts.Next, all the preparations for sparse reconstruction are complete that includes detail dictionary and early enhanced detail layer.
Theoretically, using a detail dictionary D as well as early enhanced detail nd x in the small patch x, we first optimise Eq. ( 10) to generate its sparse coefficients α * x .Second, we assemble each restored detail patches d * x = Dα * x and merge it to the entire detail layer d * .Lastly, we design a gradient guided optimisation operator to continu- ously enhance local enhancement cohence.
where d * represent optimised detail layer and ∇g represent a guided gradient that is generally correlated to input image and 1 represent regularisation parameter, we set 0.05 in our study.However, we merely achieve a perfect guided gradient since local coherence is not certain following conventional detail enhancement.When compared to nd , we can see that an input image contains optimal local coherence.So, we select its gradient as average guided gradient and set a small value 1 in order to balance local coherence and enhancing impact.The optimised detail layer d * is combined to obtain the enhanced result E = I + d * .The schematic flow diagram is shown in Fig. 1.An optimised detail by Eq. ( 14) can considerably boost local coherence and generate a high-quality image.

Camera response model (CRM)
In this study, we compute an enhanced image, where images collected from the similar camera in the similar environments with constant intensity conditions.The traditional Retinex algorithm adopts that the amount of light reaching the observers could be divided into two portions.
where (R, T) represents scene reflectance map and the illumination map.E represents an amount of light that reaches the camera sensor i.e., image irradiance.While • stands for element-wise multiplication function.As per Eq. ( 4), the CRM and camera irradiance model E could be utilised to obtain input low illumination image P.
As earlier mentioned, an enhanced image P ′ is expressed by In above equation, 1 indicates a matrix where all components are ones.We can describe a relationship between P and P ′ byor where ⊘ indicates elementwise division.The output P ′ are produced by adjusting an exposure of source image P according to the Eq.(18).Thus, the output image could be expressed as However, for instance we replace P by L as an input image which is an initial enhanced output from the dictionary learning and sparse reconstruction ("Detailed-based dictionary learning" and "Sparse reconstruction" sections).Therefore Eq. ( 19) is further re-written as P ′ = g(P, 1⊘T) = g(P, K).
(20) P ′ = g(P, 1⊘T) = g(L, K).In contrast to constant exposure ratio k in Eq. ( 5), an exposure ratio K in Eq. ( 20) represent a matrix that specifies the desirable exposure ratio for each pixel.The exposure ratio map K is defined as Further, this process mainly splits into two stages based on Eq. ( 20): (a) First, determine a suitable CRM and its parameters (b) Next, estimate an exposure matrix K for ensuring all pixels reach the desirable exposures.

CRM determination
We make no assumptions about the employment of camera response models in our work.Yet, the effectiveness of different camera response models differs.Some models with suitable functional forms can accurately describe the response properties of most real-world cameras, while others cannot.Therefore, we must use a suitable camera response model for our study to enhance the efficiency of the proposed strategy.Here, we present a few popular models before evaluating how well they function.The camera response curves (CRCs) could be utilised simply for improving low illumination photographs without the assumption of any functional forms of BTF and CRF.The computer stores CRCs as sampling points.In accordance with Eq. ( 6), we could determine the scatter of BTF for a specific exposure ratio k utilizing the subsequent formula as Thus, an enhanced image P ′ can be computed utilising interpolation strategies like spline interpolation.Besides utilising camera response curves directly, numerous computer vision algorithms including radiometric calibration can benefit from assuming the functional forms of BTF or CRF.Some articles make camera response models assumption using functional version of CRF f .A two-parameter Sigmoid model on the basis of human vision system that assumes CRF in Ref. 45 : where a and b are model parameters.As per the Eq. ( 6), the BTF for the Sigmoid could be determined by In contrast to Sigmoid which has a static number of parameters, numerous techniques proposed models with a diverse number of parameters to fulfil many application requirements.Those models utilise numerous bases.A linear combination of the basis is then used to express the CRF as where N indicates number of parameters, c 1 , . . ., c M is a model parameter.The computing inverse CRF f −1 closed- form solutions for these models are often difficult.Hence, it is equally challenging to retrieve the functional forms of BTF.Therefore, utilising these models, we required to sample CRF and obtains CRCs at initial to enhance low-light photographs.The enhanced images and BTF curves are then computed.
The trigonometric model 44 and polynomial model 46 could be observed as utilising the similar base function f 0 (E) := E with variable basis h n (E).A polynomial model utilises basis h n (E) := E n+1 − E , whereas the trigo- nometric model make use of half sine basis h n (E) := sin(nπ E) .By investigating CRCs 44 , proposed a EMoR empirical model.The real-world response curves from DoRF dataset 44 were used to derive the eigenvectors of the curves using principal component analysis (PCA).A CRF of particular camera could be then denoted using Eq. ( 25) with f 0 (E) := f 0 and h n (E) := h n while f 0 indicate average curve of DoRF dataset and h n indicate n-th eigen vector.By making an assumption of the functional form of BTF g enables to obtain camera response mod- els.Contrary to when computing BTF g utilising an assumption of CRF f , there are uncertainties while utilising an assumption of g for estimating f 47 .In order to eliminate these uncertainties, one must either assume on the exposure ratio k or on the form of CRF f .Gamma correction is a method that is often used to make images lighter or darker.This approach allows one to express BTF on real-world cameras as an exponential function.
where γ represent model parameter based on exposure k .The CRF of Gamma correction in Ref. 48is assumed as when parameter a satisfies k a = γ .As per Eq. ( 27), a CRF of gamma correction do not pass the origin which means it does not satisfy the hypothetical space f in Eq. (7).Consequently, employing gamma correction to enhance photographs might not be acceptable 48 .A few image enhancing algorithms, like LIME 49 and DEMEF 50 , makes the assumption that BTF is a linear function.For instance, LIME recommends that enhanced image P ′ could be computed by  20), the BTF of LIME can be expressed by where β = k c = kc.Thus, utilising Eq. ( 6) and the hypothetical space of f , we can obtain its CRF by while the CRF fulfils the basic requirements of CRF hypothetical space, these models assume a linear BTF which may not be the case for several cameras.As a result, distortions may be present in the resultant enhanced photos.The beta gamma correction suggested in Ref. 51 could be observed as a development of gamma correction and LIME.In order to improve low illumination photographs, a two-parameter CRM is proposed.A BTF of beta gamma correction can be expressed as where (β, γ ) factors are based on exposure K.After assumptions and inferences, we retrieve a CRF of beta gamma as where a = log k ϒ, b = lnβ 1−ϒ and c = log k β.When γ = 1, the BTF and CRF of beta gamma correction is similar to LIME.Further in beta gamma correction, when γ = 1, the BTF and CRF are two parameter nonlinear functions.In Ref. 43 presents the most popular camera response models and the capability of these models are studied.An important indicator for CRMs is the competence of fitting the real-world camera CRCs.The real-world CRCs from DoRF dataset are fitted using CRF in each camera model.By resolving the following optimisation concern, an optimal parameter of each CRT model is determined by where (E i , L i ) represents i-th sampling points of specific CRCs and M represent a total number of sampling points.This study utilises a sampling practice from Ref. 52 in order to resolve the optimisation concern in Eq. (33).A goodness of fit for every model is computed by RMSE.In general, LIME, Sigmoid, and EMoR get reasonably decent outputs, which specifies that they are more accurate than other models at obtaining enhanced results.The three-parameter EMoR model and the two-parameter Sigmoid model almost has similar perfoance.The exposures of underexposed photographs are then adjusted using these models.To determine camera response curves through multiple exposure photographs, the method by Ref. 53 is used.The four representative models are selected in order to use Eq. ( 33) for fitting the obtained curves.The well exposed images are estimated employing a specified exposure ratio for enhancing the low light photographs.In general, the output of response models such as beta gamma correction and LIME exhibits apparent distortions.This is due to these two models fails to adequately determine the response properties of camera.Less distortions may be seen in case of Sigmoid and EMoR models.

Determination of model parameters
The parameters of the camera response model must be established for each image.As earlier stated, CRF determine the response properties of cameras.Thus, variety of cameras hold different CRCs.Depending on the cameras, the response curves for three colour channels are also diverse.The three-channel response curves f r , f g , f b for each camera should theoretically be determined.However, it is challenging to precisely define the threechannel curves f r , f g , f b for this study.Often, we only have low illumination source image and don't know the camera settings.There are numerous techniques introduced to get camera response curves 54 , but these techniques might not be very trustworthy if the quality of source image is relatively poor.For the theoretical example, we use two sample from single image CRF algorithm 55 for estimation of f r , f g , f b from low light photographs and simultaneously improve the poor-quality image utilising the estimate curves.These studies employ traditional techniques and CNN networks.It is clear that there are obvious distortions in the results obtained utilising the curves computed by these techniques.Also, the three-channel channel curves f r , f g , f b need to be estimate for each input image since we do not know the camera settings which reduces efficiency.As a result, we approximate real curves by using a suboptimal CRCs of the real-world response curves in DoRF dataset f instead computing of f r , f g , f b .Then, the model parameters can be determined by resolving the optimisation problem in Eq. (33).

Estimation of exposure ratio map
An exposure ratio map K is estimated in this section.As already specified earlier, K and illumination map T are inversely proportional.Hence, we first determine T and then compute K.The computation of scene illumination from the photographs is an ill-posed concern.A presumption that illumination T of the scene is an edge preserving as well as texture removing low frequency range is one that is often employed to tackle this problem.The illumination of for image processing task can therefore be estimated using a variety of method 56 .To assist to find (28) Vol:.( 1234567890 T in this paper, we use speed-up solver presented in Ref. 49 .The illumination map T is first obtained and further refined exposure ratio map K is tentatively determined utilising Eq. ( 21).Nevertheless, a signal-to-noise ratio (SNR) will reduce for most of the photographs when illumination level reduces.The generated photographs will contain a significant amount of noise if a pixel with a very low SNR score is given a larger exposure ratio value.
The denoising procedures can be used as a post processing strategy however doing so will make our approach less effective.Hence, we set a maximal exposure value for pixels with extremely low illumination.
where T min represent a threshold value.We consider that pixel with illumination less than T min has very less SNR score and assigned it a fixed exposure ratio 1 T min .Figure 2 shows an example case.It is observed that the T min .plays an important role in image enhancement task.
In general, the enhanced image will exhibit visible noise, which degrades the quality of the image if a maximum exposure ratio value is not set.While the maximum exposure ratio may diminish visibility in extremely dark regions, it enhances the photographic perception of the enhanced results by reducing image noise significantly.After computing the exposure ratio map K, we apply K in Eq. ( 20) to obtain the final enhanced results.

Experimental results
We compare our proposed method with several existing techniques by conducting an extensive experiment with both subjective and objective aspects.Our method is compared with numerous competing techniques, including semi-decoupled decomposition (SDD) 6 , attention guided image enhancement (AGIE) 25 , progressive recursive image enhancement network (PRIEN) 27 , unsupervised image enhancement using decoupled networks (UIE-DN) 32 and context sensitive decomposition network (CSDNet) 24 .To properly measure our technique, we tested it on images of numerous scenes.We use the publicly available dataset of LIME 49 , BSDS500 57 , NPE 58 , Flickr 59 , UIEB 60 and 2016 NIH-AAPM-Mayo Clinic Low Dose CT Grand Challenge 61 for evaluation and validation of the proposed algorithm.The total of 11 images are considered for presentations in this study, as shown in Fig. 3.For a quantitative comparison, we utilised feature similarity index (FSIM) 31 along with some recently proposed metrics, including measure of enhancement (EME) 42 , mean absolute error (MAE) 31 , entropy 62 , visual information fidelity (VIF) 63 and average brightness (AB) 64 .All indicators tend to favour higher numbers with the exception of MAE and AB.We also conducted a parameter study to evaluate the effects of scale factor, regularisation parameter and local window radius on the proposed method.

Experimental details
We train the overcomplete dictionary, which requires roughly 30 min for dictionary training by sampling 100,000 patches and using iterative optimisation.In contrast, sparse reconstruction for all small patches takes between 100 and 300 s at diverse resolutions (400 × 300, 600 × 480, and 800 × 600).In general, a guided filter 37 is used to generate an initial boosted detail layers which are then added to sparse reconstruction.Our method uses the Sigmoid camera response model.We apply the Sigmoid model to fit a suboptimal curve of the DoRF dataset and recover model parameters a = 0.6 and b = 0.9.In the case of the exposure map solver K, we utilise the default parameters of LIME for solving an illumination map T and set T min = 1 7 to retrieve K in all experiments.The parameters regularisation parameter ( ) , scale factor (n) and local window radius (r) are set to 0.05, 5, and 16, respectively.In addition, the parameter σ are fixed to 2. These experimental settings normally produce better results.In all experiments, we utilise default settings presented by their respective authors for all other competing methods.All the simulations are carried out in Matlab R2021b on a PC running with Windows 10 OS with 16 GB of RAM and a 3.5 GHz CPU.The study trains two detail dictionaries, one with 512 atoms and the other with 1024 atoms.We first degrade the detail layers of the high-quality images to create low-quality versions of the 200 source images.We use two separate dictionaries to get enhanced results from these low-quality images.We also create a testing set of 100 images, comprising 90 genuine high-quality images and 11 enhanced by our model.On top of that, we selected the 11 enhanced images from the testing set by organising 15 testers to compare their appearances.

Results and discussion
The visual results produced by numerous methods are shown in Figs. 4, 5, 6, 7, 8, 9, 10, 11 and 12.A narrowly scattered histograms of low illumination images are stretched by SDD to increase contrast.There are visible artefacts in flat portions when constant values of adjacent pixels are stretched out.However, our method generates artifacts images with visually satisfying appearance.Visible halo artefacts are generated by UIE-DN and CSDNet in some places as shown in halo around the bushes in image a (see in Fig. 5).As observed in image b, SRIE and PIE are unable to appropriately increase the visibility of input image (see in Fig. 9).However, the  proposed approach can generally prevent halo artefacts plants in image e (see in Fig. 6) and the street in image d (see in Fig. 4).In fact, our proposed strategy and yields satisfactory results.While PRIEN aims to preserve the authenticity of images, the larger part of its output has vibrant colour.However, some elements in its results are lost such as textures of outperforms the other methods when it comes to appropriately preserving these textures.The AGIE performs worthily in illuminating dark regions.The flower in image f 1 (see in Fig. 7) and the streetlights textures in image g1 are two examples of how this technique could simply over enhanced regions with relatively high intensities (see in Fig. 8).In contrast, the proposed strategy yields more realistic performance while effectively boosted perceptibility of low illumination images.In addition to the qualitative visual comparisons, we utilise quantitative metrics to evaluate an efficiency of proposed strategy.Since evaluating the quality of enhancement results in not an easy task, we utilise FSIM, entropy, VIF, EME, MAE and AB to evaluate the enhancement result comprehensively.The average FSIM, entropy, VIF, EME, MAE and AB results of the low-light input images a, bandd are shown in Tables 1, 2 and 3 along with the results of all the comparative low-light image enhancing methods.Higher numbers indicate higher image qualities for FSIM, entropy, VIF and EME.To evaluate the distortion of the input image, FSIM compare the structural and feature similarity measurements between enhanced and input images.It is based on the gradient magnitude and phase congruency.The VIF is a full reference index for evaluating image quality that is based on both the idea of image information retrieved by human visual system and natural scene statistics.Higher EME number indicates a clearer image with more contrast www.nature.com/scientificreports/and information.Information entropy or entropy is a term used to characterise the degree of randomness (or uncertainty) in a signal or an image.The average FSIM, entropy, VIF, EME, MAE and AB scores of the proposed method obtained ideal among the other techniques.Although FSIM, entropy, VIF, EME scores are marginally higher than other methods, their MAE and AB values are substantially higher than those of our technique which is ideal for better enhancing performance.The images "g" in Fig. 9 and "b" in Fig. 10 show how some of the results generated by AGIE do not appear natural when compared visually.The PRIEN cannot properly enhance the entire  (a1) (g1   (   Table 1.Quantitative results of a test image " c"."↑ " represents higher the better, " ↓ " represents lower the better and " ⇓ " represents lowest absolute value are better.Significant values are in bold.Similarly, other competing methods marginally blur some minute information in images while preserving some noise information in roof, wall, window, and tree.Using the objective metric FSIM, Entropy, VIF, EME, MAE and AB, we also statistically compare the results.To sum up, our method performs well for images with higher noise.Our subsequent study might involve integrating our method with noise detection, estimation techniques and automatically determining which model could be ideal for the source images.

Parameter study
This section evaluates the impact of different parameters on the proposed method.In addition, we also examine how these parameters affect enhancement performance.On all of the test images, we present the quantitative Table 2. Quantitative results of a test image " d"."↑ " represents higher the better, " ↓ " represents lower the better and " ⇓ " represents lower absolute value are better.Significant values are in bold.3. Quantitative results for test image "f"."↑ " represents higher the better, " ↓ " represents lower the better and " ⇓ " represents lowest absolute value are better.Significant values are in bold.In Fig. 13, we presented multiple bar graphs representing the effects of the regularisation parameter (λ), scale factor (n) and local window radius (r) on the proposed method.We considered a regularisation parameter (λ) of (0, 0.05, 0.1, 0.5, 1).Similarly, we consider scale factor (n) of (1, 3, 5, 7, 9) and local window radius (r) of (10, 13, 16, 19, 22) in image " c ." for simulations.As we can observe, performances are not consistent in terms of these parameters.In our study, we set the regularisation parameter λ, scale factor n and local window radius (r) to 0.05, 5, and 16, respectively.We tried different values for these parameters during the experiments to optimise the best value.In general, the parameters limit the intensity of the noise map, sometimes smaller values oversaturate the results and higher values generate more noise.In Fig. 13, we examine the impacts of parameters in more detail, and it shows numerous valuable pieces of information.The proposed method is tested with a variety of other imaging modalities images, such as medical images, underwater or remote sensing images, as well as images captured in foggy or dusty environments to provide further validation on whether the proposed image enhancement scheme can maintain consistent performance across various lighting conditions and image content, as well as its adaptability to unknown scenarios.We can observe that, the proposed method shows consistent performance in these images with high quality enhanced results with negligible distortions and noise.

Conclusions
This study presents a novel low-light image enhancement strategy using a camera response model and a detailedbased dictionary learning model.We sampled a large set of detail patches from high quality images to construct a training set for learning an overcomplete detail dictionary using an iterative ℓ 1 -norm minimization.Besides, we utilise a detail dictionary to recover an enhanced detail patches from the input image and then enhance local coherence between patches using gradient guided optimisation.To get enhanced results, we additionally recommend local exposure adjustment of low illumination images utilising cameral response models.To improve low-light images, we apply illumination estimation schemes to the selected CRM and subsequent exposure ratio maps.To examine the performance of visibility enhancement, we also proposed a reference evaluation metric and a non-reference quantitative evaluation metric.The results of the proposed technique have shown that our strategy is much better than many other existing techniques.In addition to low-light image enhancement, the proposed approach is applicable for several other similar applications, including enhancing medical images, underwater or remote sensing images, and foggy or dusty environment images.The proposed method was able to produce high quality perceptibility enhancement results, but it requires lots of processing time and memory to train the over-complete detail dictionary and reconstruct each detail patch which is its limitation.Besides, future work will focus on streamlining the training and reconstruction procedures as well as introducing some advanced techniques.Our future work will also emphasize other image and video enhancement applications. https://doi.org/10.1038/s41598-024-64421-wwww.nature.com/scientificreports/

Figure 1 .
Figure 1.Flowchart of the proposed image enhancement method.

Figure 2 .
Figure2.Input image and enhanced results using Eq.(34) with different T min .

Figure 3 .
Figure 3. Eleven sample images are used for presentation.These are represented as (a-j).

Figure 13 .
Figure 13.The effect of parameters; (a) Regularisation parameter , (b) Scale factor n and (c) Local window radius r with respect to evaluation metrics EME, FSIM, VIF, AB, MAE, and Entropy on the proposed method.Zoomed-in to have a clear viewing experience.
(Figs. 6, 7)and produces halo artefacts.In terms of VIF and EME higher scores represent better visual contrast.Using three criteria such as signal strength mean intensity, and signal structure elements, FSIM measures perceptual differences between enhanced results and the input ones.The enhanced image quality has been deteriorated instead of improvement according to the FSIM score of lesser than 1.The proposed method which earns the maximum VIF score successfully improves the overall image quality without significantly increasing artefacts.While evaluating the quality of images, VIF measures the local features of images and global histogram thus favouring photographs with greater contrast.In addition to these images, we have presented enhancement results of medical, underwater, and dusty environment images as shown in Figs.10, 11 and 12.In contrast, the proposed method has achieved excellent performance compared to other comparative state-of-the-art methods.We can see that the VIF scores of SDD and AGIE are low and generates poor enhancement results of the input image.We studied how well our enhancement algorithm performs in noisy cases.There is noise in this situation on other channels as well apart from the different channel.To apply the proposed method to each channel, an input image is transformed into RGB colour space.For this challenge, both of the parameters are set to 0.01.Figures4, 5, 6, 7, 8, 9, 10, 11 and 12 displays the results of image enhancement for low-light images.The noise that is hidden under very low light conditions is extremely powerful.While PRIEN and UIE-DN can positively enhance perceptibility of low illumination photographs but they also increase intense noise.The UIE-DN is unable to illuminate the input images, and its output also exhibits obvious noise.Our approach handles low-light photographs with significant noise with satisfactory performance.We compared the findings of our technique with those from other techniques extensively.As observed in Fig.8, when the low illumination of images by the SDD and AGIE is not restored appropriately thus numerous erroneous small structures are produced.The CSDNet generates over-enhanced result, particularly in regions having more illumination.Further, a denoising procedures inevitably blurs the entire image.Nevertheless, the performance of our technique appears more natural and sharper.Using 200 images from LIME, we examine the results of our method with that of competing techniques.Tables 1, 2 and 3 lists the average quantitative evaluation results generated from different images using several comparative methods where the best results are denoted in bold.It can be observed that, our proposed method exceeds other methods in case of all evaluation metrics.The proposed technique efficiently removes larger part of noise as demonstrated in Figs.4, 5, 6, 7, 8, 9, 10, 11 and 12, when compares to other techniques.